package cn.krund.lyc.hotlerobot.Ros.service;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;

import cn.krund.lyc.hotlerobot.service.RemoteControlService;

/**
 * @包名: cn.krund.lyc.hotlerobot.robot.service
 * @作者: 刘育成
 * @时间: 2018/3/27  10:52
 * @org: 克路德人工智能
 * @描述: TODO
 * @fileName: UpdateCommunicationInfoTask
 */

public class UpdateCommunicationInfoTask {
    private ScheduledExecutorService mExecutorService;                    //线程池
    private static final int poolSize = 2;                               //线程池数量
    private RemoteControlService mService;                               //远程控制服务
    private static final int initialDelay = 1;                          // 设置多少秒后执行任务
    private static final int delay = 5;                                 // 设置间隔多少秒后执行一次任务

    public UpdateCommunicationInfoTask(RemoteControlService service) {
        mExecutorService = Executors.newScheduledThreadPool(poolSize);
        this.mService = service;
    }

    /**
     * 开始更新
     */
    public void startUpdata() {
        if (mExecutorService == null) return;


    }

    /**
     * 停止更新
     */
    public void stopUpdata() {
        if (mExecutorService != null) {
            mExecutorService.shutdownNow();
        }
    }
}
